<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./axios.min.js"></script>
</head>

<body>
  hello world
  <input id="fileInput" type="file" multiple />
</body>

<script>
  async function urlParam() {
    const res = await axios.get('/person');
    console.log(res);
  }
  urlParam();

  const fileInput = document.querySelector('#fileInput');

  async function formData() {
    const data = new FormData();
    data.set('name', '光');
    data.set('age', 20);
    data.set('age2', 20);
    data.set('file1', fileInput.files[0]);
    data.set('file2', fileInput.files[1]);
    const res = await axios.post('/person/file', data, {
      headers: { 'content-type': 'multipart/form-data' }
    });
    console.log(res);
  }

  fileInput.onchange = formData;

</script>

</html>